package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;

import com.zzyl.nursing.dto.UserLoginRequestDto;
import com.zzyl.nursing.service.IFamilyMemberService;
import com.zzyl.nursing.service.WechatService;
import com.zzyl.nursing.vo.LoginVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 老人家属Controller
 * 
 * @author alexis
 * @date 2025-06-28
 */
@Slf4j
@Tag(name="老人家属管理")
@RestController
@RequestMapping("/member/user")
public class FamilyMemberController extends BaseController
{
    @Autowired
    private IFamilyMemberService familyMemberService;
    @Autowired
    private WechatService wechatService;

    @PostMapping("/login")
    @Operation(description="小程序登录")
    public AjaxResult login(@RequestBody UserLoginRequestDto userLoginRequestDto){
        log.info(userLoginRequestDto.toString());
        log.info("小程序登录，传递的code：{}", userLoginRequestDto.getCode());
        LoginVo loginVo = familyMemberService.login(userLoginRequestDto);
        return success(loginVo);
    }




}
